setClass("vRowBootstrapedSet",contains="VBootstrapedSet",
		representation("VIRTUAL"),
		prototype=prototype(
				.description="vRow bootstrap Class"
		)

) 
#methods


setMethod("initialize",
		signature="vRowBootstrapedSet",
		definition=function(.Object,inputSet,bSamplesNumber,...){
			.Object <-callNextMethod(.Object,inputSet,bSamplesNumber,...);
			
			
			.Object@.bSetRepresentation <-(bootstrap( 1:(dim(.Object@.originalSet$X )[1]),.Object@.bSamplesNumber,
											function(x){x}))$thetastar
						
			return(.Object)
		})

setMethod("changeSet",
		signature="vRowBootstrapedSet",
		definition=function(.Object,inputSet,...){
			.Object<-initialize(.Object,inputSet=inputSet,bSamplesNumber=.Object@.bSamplesNumber,...)
			
			
			return(.Object)
		})

setMethod("getAt",
		signature="vRowBootstrapedSet",
		definition=function(.Object,position,...){
			#modify X
			if(position < 0 | position > .Object@.bSamplesNumber){
				stop("Index out of bound")
			}
			.Object@.currentSet$X <- .Object@.originalSet$X[ .Object@.bSetRepresentation[, position ] , ]
			
			#modify Y if exists
			if(.Object@.areClassesPresent){
				.Object@.currentSet$Y <- .Object@.originalSet$Y[ .Object@.bSetRepresentation[, position ] ];
			}
			
			return(.Object@.currentSet)
			
		})

